Skip to content

Conversation

@jack-dunham
Copy link
Contributor

@jack-dunham jack-dunham commented Oct 28, 2025

This PR expresses the BP code in terms of the SweepIterator and RegionIterator interface. It also defines a subtype of AbstractProblem to host the BP relevant data structures (the cache and the diff).

The set_default_kwargs system has also been simplified, instead being defined in terms of a single default_algorithm function.

I think certain aspects could be improved depending on how "radical" we wish to be; this was sort of a "minimal viable example" of putting BP in SweepIterator. For example, the Algorithm"bp" type seems a bit redundant/is not used to its full potential.

The first BP test (on MPS) passes always, but the test on the comb fails as the difference between the two values is sometimes slightly more than the tolerance 1e-14 (tensors used are random). This should be exact to machine precision after a single iteration, no?

@mtfishman
Copy link
Member

Very interesting, I had vaguely wondered if the sweep_solve code could be used to help implement BP. Curious to hear more about it.

JoeyT1994 and others added 4 commits October 31, 2025 12:39
Introduce `BeliefPropagationProblem` wrapper to hold the cache and the
error `diff` field.

Also simplifies some kwargs wrangling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants